<!DOCTYPE html>
<html lang="en">
<head>
    <title>密码强度实时验证</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
<h2>密码强度实时验证</h2>
<input id="passwordStrength" data-hint='请输入密码' type="password"> <span id="showStrength"></span>
<script>
    window.onload = function () {

        let charStrength = function (char) {
            if (char >= 48 && char <= 57) {
                return 1;
            }
            if (char >= 97 && char <= 122) {
                return 2;
            } else {
                return 3;
            }
        };

    };
</script>
</body>

</html>